package com.jida.weather.controller;

import com.jida.weather.domain.WeatherResponse;
import com.jida.weather.service.WeatherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 处理天气数据访问的接口类
 */
@RestController   //先返回给用户json格式的数据
public class WeatherController {

    @Autowired
    WeatherService weatherService;

    @RequestMapping("/getWeather")
    public WeatherResponse getWeather(String city){  // key:我的key   type:1

        //调用service  访问第三方接口获取天气数据


        return weatherService.accessThree(city);
    }
}
